from flask import Blueprint, request, jsonify

from utils.file_util import FileUtil

file_app = Blueprint("file_app", __name__)

@file_app.route('/upload', methods=['POST'])
def file_upload():
    # 返回文件上传结果信息
    requ_data = {
        'file': request.files.get('file'),
        'file_info': dict(request.form)
    }
    resp_data = FileUtil.resp_file_upload(requ_data)

    return jsonify(resp_data)

@file_app.route('/draw', methods=['GET'])
def file_draw():
    FileUtil.file_draw('C:/Users/Hang/Desktop/data_01.xlsx')